﻿<common:LayoutAwarePage
    x:Name="pageRoot"
    x:Class="RuneMasterWin8.Pages.ToolChoosePage"
    DataContext="{Binding DefaultViewModel, RelativeSource={RelativeSource Self}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:RuneMasterWin8.Pages"
    xmlns:common="using:RuneMasterWin8.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:Views="using:RuneMasterWin8.Views"
    mc:Ignorable="d">

    <Page.Resources>

        <!-- TODO: Delete this line if the key AppName is declared in App.xaml -->
        <x:String x:Key="AppName">My Application</x:String>
        <Style x:Key="ButtonStyle1" TargetType="Button">
        	<Setter Property="Template">
        		<Setter.Value>
        			<ControlTemplate TargetType="Button">
        				<Grid>
        					<VisualStateManager.VisualStateGroups>
        						<VisualStateGroup x:Name="CommonStates">
        							<VisualState x:Name="Normal"/>
        							<VisualState x:Name="Pressed">
        								<Storyboard>
        									<ColorAnimation Duration="0" To="#FF4D0000" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FF8B0202" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="Disabled">
        								<Storyboard>
        									<ColorAnimation Duration="0" To="#FF474747" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<DoubleAnimation Duration="0" To="0.004" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Offset)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        									<ColorAnimation Duration="0" To="#FF5F5F5F" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" Storyboard.TargetName="border" d:IsOptimized="True"/>
        								</Storyboard>
        							</VisualState>
        							<VisualState x:Name="PointerOver"/>
        						</VisualStateGroup>
        					</VisualStateManager.VisualStateGroups>
        					<Border x:Name="border" BorderBrush="White" BorderThickness="1" CornerRadius="10">
        						<Border.Background>
        							<LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
        								<GradientStop Color="#FFFF3232"/>
        								<GradientStop Color="#FF870000" Offset="1"/>
        							</LinearGradientBrush>
        						</Border.Background>
        					</Border>
        					<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
        				</Grid>
        			</ControlTemplate>
        		</Setter.Value>
        	</Setter>
        	<Setter Property="FontWeight" Value="Bold"/>
        	<Setter Property="FontSize" Value="64"/>
        </Style>
    </Page.Resources>

    <!--
        This grid acts as a root panel for the page that defines two rows:
        * Row 0 contains the back button and page title
        * Row 1 contains the rest of the page layout
    -->
    <Viewbox>
		<VisualStateManager.VisualStateGroups>
<!-- Visual states reflect the application's view state -->
			<VisualStateGroup x:Name="ApplicationViewStates">
				<VisualState x:Name="FullScreenLandscape"/>
				<VisualState x:Name="Filled"/>

                <!-- The entire page respects the narrower 100-pixel margin convention for portrait -->
				<VisualState x:Name="FullScreenPortrait">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource PortraitBackButtonStyle}"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>

                <!-- The back button and title have different styles when snapped -->
				<VisualState x:Name="Snapped">
					<Storyboard>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="backButton" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedBackButtonStyle}"/>
						</ObjectAnimationUsingKeyFrames>
						<ObjectAnimationUsingKeyFrames Storyboard.TargetName="pageTitle" Storyboard.TargetProperty="Style">
							<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource SnappedPageHeaderTextStyle}"/>
						</ObjectAnimationUsingKeyFrames>
					</Storyboard>
				</VisualState>
			</VisualStateGroup>
		</VisualStateManager.VisualStateGroups>
		<Grid Style="{StaticResource LayoutRootStyle}" Height="768" Width="1366">
			<Grid.RowDefinitions>
				<RowDefinition Height="140"/>
				<RowDefinition Height="*"/>
			</Grid.RowDefinitions>

			<!-- Back button and page title -->
			<Image Source="ms-appx:///Images/background_dark.png" Stretch="Fill" Grid.RowSpan="2"/>

			<!-- Back button and page title -->
			<Grid>
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto"/>
					<ColumnDefinition Width="*"/>
				</Grid.ColumnDefinitions>
				<Button x:Name="backButton" Click="GoBack" IsEnabled="{Binding Frame.CanGoBack, ElementName=pageRoot}" Style="{StaticResource BackButtonStyle}"/>
				<TextBlock x:Name="pageTitle" Grid.Column="1" Style="{StaticResource PageHeaderTextStyle}" Text="购买道具"/>
			</Grid>
			<Grid x:Name="gridStageInfo" Margin="143,252,1023,252" Grid.Row="1" VerticalAlignment="Center">
				<Grid HorizontalAlignment="Left" VerticalAlignment="Top" Width="200">
					<Image x:Name="imgGameModeEasy" Source="/Images/easy.png" HorizontalAlignment="Center" VerticalAlignment="Center"/>
					<Image x:Name="imgGameModeNormal" Source="ms-appx:///Images/normal.png" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
					<Image x:Name="imgGameModeHard" Source="ms-appx:///Images/hard.png" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
				</Grid>
				<TextBlock x:Name="txtStageName" HorizontalAlignment="Left" Margin="37,85,0,0" TextWrapping="Wrap" Text="STAGE 1" VerticalAlignment="Top" FontSize="32" FontFamily="Segoe WP Semibold" Foreground="#FFFFF300"/>
			</Grid>
			<Grid Margin="0,28,0,32" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center">
				<Rectangle Fill="#19FFFFFF" HorizontalAlignment="Left" Height="568" VerticalAlignment="Top" Width="396" RadiusX="10" RadiusY="10" StrokeThickness="2"/>
				<Grid Margin="20,23,17,0">
					<TextBlock x:Name="txtTotalG" TextWrapping="Wrap" Text="10000 G" TextAlignment="Center" Foreground="#FFFF9C00" FontSize="26.667" VerticalAlignment="Top" HorizontalAlignment="Center" Margin="0,4,0,0"/>
					<Path Data="M17.6667,40 L335.794,40" Fill="#FFF4F4F5" HorizontalAlignment="Center" Height="1" Margin="0,40,0,0" Stretch="Fill" Stroke="#FFC9C9C9" UseLayoutRounding="False" VerticalAlignment="Top" Width="319.127"/>
					<Path Data="M17.6667,40 L335.794,40" Fill="#FFF4F4F5" HorizontalAlignment="Center" Height="1" Margin="0,195,0,0" Stretch="Fill" Stroke="#FFC9C9C9" UseLayoutRounding="False" VerticalAlignment="Top" Width="319.128"/>
					<Grid HorizontalAlignment="Left" Height="144" Margin="20,46,0,0" VerticalAlignment="Top" Width="319" Background="#19FFFFFF">
						<TextBlock x:Name="txtToolName" HorizontalAlignment="Left" TextWrapping="Wrap" Text="道具名称" VerticalAlignment="Top" FontSize="18.667" Margin="5,1,0,0" Foreground="White"/>
						<TextBlock x:Name="txtToolCount" HorizontalAlignment="Right" Margin="0,1,3,0" TextWrapping="Wrap" Text="(数量)" VerticalAlignment="Top" FontSize="18.667" Foreground="White"/>
						<TextBlock x:Name="txtToolDescribe" HorizontalAlignment="Left" Height="89" Margin="5,31,0,0" TextWrapping="Wrap" Text="点击道具可以查看道具明细" VerticalAlignment="Top" Width="311" FontSize="16" Foreground="White"/>
						<TextBlock x:Name="txtToolCost" HorizontalAlignment="Right" Margin="0,117,8,0" TextWrapping="Wrap" Text="价格" VerticalAlignment="Top" FontSize="18.667" Foreground="Yellow"/>
					</Grid>
					<StackPanel Margin="0,215,0,0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top">
						<StackPanel Orientation="Vertical" VerticalAlignment="Top" Width="61">
							<Views:ToolItem x:Name="toolAdd500" ToolTypeValue="1" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61"/>
							<Views:ToolItem x:Name="toolScore2" ToolTypeValue="3" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61" Margin="0,15,0,0"/>
						</StackPanel>
						<StackPanel Orientation="Vertical" VerticalAlignment="Top" Width="61" Margin="30,0,0,0">
							<Views:ToolItem x:Name="toolReset" ToolTypeValue="2" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61"/>
							<Views:ToolItem x:Name="toolSpirit2" ToolTypeValue="6" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61" Margin="0,15,0,0"/>
						</StackPanel>
						<StackPanel Orientation="Vertical" VerticalAlignment="Top" Width="61" Margin="30,0,0,0">
							<Views:ToolItem x:Name="toolCollSpirit" ToolTypeValue="4" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61"/>
							<Views:ToolItem x:Name="toolAddSpirit" ToolTypeValue="5" HorizontalAlignment="Left" Height="61" VerticalAlignment="Top" Width="61" Margin="0,15,0,0"/>
						</StackPanel>
					</StackPanel>
					<Border BorderBrush="Black" BorderThickness="1" HorizontalAlignment="Center" Height="80" Margin="20,379,20,0" VerticalAlignment="Top" Width="319" CornerRadius="5" Background="#4C000000">
						<Grid>
							<Grid.ColumnDefinitions>
								<ColumnDefinition/>
								<ColumnDefinition/>
								<ColumnDefinition/>
								<ColumnDefinition/>
							</Grid.ColumnDefinitions>
							<Rectangle HorizontalAlignment="Center" Height="66" Stroke="White" VerticalAlignment="Center" Width="66" Fill="#FF6C6C6C" RadiusX="4" RadiusY="4"/>
							<Rectangle HorizontalAlignment="Center" Height="66" Stroke="White" VerticalAlignment="Center" Width="66" Fill="#FF6C6C6C" RadiusX="4" RadiusY="4" Grid.Column="1"/>
							<Rectangle HorizontalAlignment="Center" Height="66" Stroke="White" VerticalAlignment="Center" Width="66" Fill="#FF6C6C6C" RadiusX="4" RadiusY="4" Grid.Column="2"/>
							<Rectangle HorizontalAlignment="Center" Height="66" Stroke="White" VerticalAlignment="Center" Width="66" Fill="#FF6C6C6C" RadiusX="4" RadiusY="4" Grid.Column="3"/>
							<Views:ToolItem x:Name="selectTool1" IsUsedItem="True" ToolTypeValue="1" HorizontalAlignment="Center" Height="61" VerticalAlignment="Center" Width="61" Margin="0" Visibility="Collapsed"/>
							<Views:ToolItem x:Name="selectTool2" IsUsedItem="True" ToolTypeValue="1" HorizontalAlignment="Center" Height="61" VerticalAlignment="Center" Width="61" Grid.Column="1" Visibility="Collapsed"/>
							<Views:ToolItem x:Name="selectTool3" IsUsedItem="True" ToolTypeValue="1" HorizontalAlignment="Center" Height="61" VerticalAlignment="Center" Width="61" Grid.Column="2" Visibility="Collapsed"/>
							<Views:ToolItem x:Name="selectTool4" IsUsedItem="True" ToolTypeValue="1" HorizontalAlignment="Center" Height="61" VerticalAlignment="Center" Width="61" Grid.Column="3" Visibility="Collapsed"/>
						</Grid>
					</Border>
					<TextBlock x:Name="txtTotalCostG" HorizontalAlignment="Right" Margin="0,464,20,0" TextWrapping="Wrap" Text="0 G" VerticalAlignment="Top" Foreground="#FFFFF300" FontSize="21.333"/>
					<TextBlock HorizontalAlignment="Left" Margin="20,358,0,0" TextWrapping="Wrap" Text="Tool Slot" VerticalAlignment="Top" FontSize="16" Foreground="White"/>
					<TextBlock x:Name="txtWaring_Copy" HorizontalAlignment="Center" Margin="35.5,0,35.5,2.8" TextWrapping="Wrap" Text="现有的金币不能够支付道具" VerticalAlignment="Bottom" Foreground="White" FontSize="24" RenderTransformOrigin="0.5,0.5" Visibility="{Binding Visibility, ElementName=txtWaring}">
						<TextBlock.RenderTransform>
							<CompositeTransform TranslateX="2" TranslateY="2"/>
						</TextBlock.RenderTransform>
					</TextBlock>
					<TextBlock x:Name="txtWaring" HorizontalAlignment="Center" Margin="0,0,0,3" TextWrapping="Wrap" Text="现有的金币不能够支付道具" VerticalAlignment="Bottom" Foreground="Red" FontSize="24"/>
				</Grid>
			</Grid>
			<Button x:Name="btnStartStage" Content="开始&#xA;游戏" HorizontalAlignment="Left" Height="214" Margin="1004,203,0,211" Grid.Row="1" Style="{StaticResource ButtonStyle1}" VerticalAlignment="Center" Width="240" Click="btnStartStage_Click_1"/>

		</Grid>
	</Viewbox>
</common:LayoutAwarePage>
